Kick out almost all of the NEWTIME props.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 25 Mar 2013 02:11:58 +0000 (02:11 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 25 Mar 2013 02:11:58 +0000 (02:11 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4366 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/cetus.cc
gpsbabel/defs.h
gpsbabel/gopal.cc
gpsbabel/holux.cc
gpsbabel/kml.cc
gpsbabel/waypt.cc

index 8f29e2fbf0a13a8360276c4bd5c973fd89a313c5..f8d8e63941ddc6a5658ba773ad1ca3d460b3fb95 100644 (file)
@@ -455,7 +455,6 @@ cetus_writewpt(const waypoint* wpt)
 
   rec = (struct cetus_wpt_s*) xcalloc(sizeof(*rec)+18 + NOTESZ + DESCSZ,1);
 
-#if NEWTIME
   QDate date(wpt->creation_time.date());
   rec->day = date.day();
   rec->mon = date.month();
@@ -466,24 +465,6 @@ cetus_writewpt(const waypoint* wpt)
   rec->hour = time.hour();
   rec->sec = time.second();
 
-#else
-  struct tm* tm;
-  if (wpt->creation_time && (NULL != (tm = gmtime(&wpt->creation_time)))) {
-    rec->min = tm->tm_min;
-    rec->hour = tm->tm_hour;
-    rec->sec = tm->tm_sec;
-    rec->day = tm->tm_mday;
-    rec->mon = tm->tm_mon + 1;
-    be_write16(&rec->year, tm->tm_year + 1900);
-  } else {
-    rec->min = 0xff;
-    rec->hour = 0xff;
-    rec->sec = 0xff;
-    rec->day = 0xff;
-    rec->mon = 0xff;
-    be_write16(&rec->year, 0xff);
-  }
-#endif
   be_write32(&rec->longitude, (unsigned int)(int)(wpt->longitude * 10000000.0));
   be_write32(&rec->latitude, (unsigned int)(wpt->latitude * 10000000.0));
   if (wpt->altitude == unknown_alt) {
index 414e328823f0124f9cee6158b7701e5fab067e0a..0d49c9dfdc877281d7aa60c97d4e69eb85660862 100644 (file)
@@ -41,9 +41,7 @@
 #include "inifile.h"
 #include "session.h"
 
-#if NEWTIME
 # include "src/core/datetime.h"
-#endif
 
 // Turn on Unicode in expat?
 #ifdef _UNICODE
@@ -459,11 +457,6 @@ public:
   description(NULL), 
   notes(NULL), 
   url_next(NULL), 
-#if NEWTIME
-//  creation_time(QDateTime::fromTime_t(0)),
-#else
-  creation_time(0), 
-#endif
   microseconds(0), 
   route_priority(0), 
   hdop(0), 
@@ -540,11 +533,7 @@ public:
 
   wp_flags wpt_flags;
   QString icon_descr;
-#if NEWTIME
   gpsbabel::DateTime creation_time;
-#else
-  time_t creation_time;        /* standardized in UTC/GMT */
-#endif
   int microseconds;    /* Optional millionths of a second. */
 
   /*
index 97aa7e0c5c9c3132a0c3105774bd5ff316c02953..59e9cdfb18ab277fac3dda7b26bf6d4b8821bb09 100644 (file)
@@ -351,11 +351,7 @@ gopal_write_waypt(const waypoint* wpt)
   int fix=fix_unknown;
   //TICK;    TIME;   LONG;     LAT;       HEIGHT; SPEED;  UN; HDOP;     SAT
   //3801444, 080558, 2.944362, 43.262117, 295.28, 0.12964, 2, 2.900000, 3
-#if NEWTIME
   snprintf(tbuffer, sizeof(tbuffer), "%06d", wpt->creation_time.hms());
-#else
-  strftime(tbuffer, sizeof(tbuffer), "%H%M%S", gmtime(&wpt->creation_time));
-#endif
   if (wpt->fix!=fix_unknown) {
     switch (wpt->fix) {
     case fix_none:
index fd1fc2381e52d02e24b1ba02587f213f4b13fed4..3def99f587a2147f773a69df146df6ec126e1dbe 100644 (file)
@@ -227,21 +227,12 @@ static void holux_disp(const waypoint* wpt)
   /*set the time */
   if (wpt->creation_time) {
     /* tm = gmtime(&wpt->creation_time);*/  /* I get the wrong result with gmtime ???  */
-#if NEWTIME
     QDate date(wpt->creation_time.date());
     QTime time(wpt->creation_time.time());
     pWptHxTmp->time = (time.hour() * 3600) + (time.minute()* 60) + time.second();
     pWptHxTmp->date.day = date.day();
     pWptHxTmp->date.month = date.month();
     pWptHxTmp->date.year = date.year();
-#else
-    struct tm* tm;
-    tm = localtime(&wpt->creation_time);
-    pWptHxTmp->time = (tm->tm_hour * 3600) + (tm->tm_min * 60) +tm->tm_sec;
-    pWptHxTmp->date.day = tm->tm_mday;
-    pWptHxTmp->date.month = tm->tm_mon + 1;
-    pWptHxTmp->date.year = tm->tm_year + 1900;
-#endif
   } else {
     pWptHxTmp->time = 0;
     pWptHxTmp->date.day = 0;
index 5e58ac2c272fccedf81a91864f413b9a3df694f1..be6b21de7a19d0cdfa88b5cdcddbed1bc87c5412 100644 (file)
@@ -1451,13 +1451,8 @@ static void kml_geocache_pr(const waypoint* waypointp)
   // Timestamp
   kml_output_timestamp(waypointp);
   if (waypointp->creation_time) {
-#if NEWTIME
     strcpy(date_placed,
            qPrintable(waypointp->creation_time.toString("dd-MMM-yyyy")));
-#else
-    strftime(date_placed, sizeof(date_placed),
-             "%d-%b-%Y", localtime(&waypointp->creation_time));
-#endif
   } else {
     date_placed[0] = '\0';
   }
index 3cf5661c695a1f82a13010e29e3e7a03f9ec7781..f7f4228ee7aedc0a5f7237c6685694b89f7e6b41 100644 (file)
@@ -231,15 +231,9 @@ set_waypt_count(unsigned int nc)
 void
 waypt_disp(const waypoint *wpt)
 {
-#if NEWTIME
   if (wpt->creation_time.isValid()) {
-  printf("%s", qPrintable(wpt->creation_time.toString()));
+    printf("%s ", qPrintable(wpt->creation_time.toString()));
   }
-#else
-  if (wpt->creation_time) {
-    printf("%s ", ctime(&wpt->creation_time));
-  }
-#endif
   printposn(wpt->latitude,1);
   printposn(wpt->longitude,0);